package com.qy566.gps.pulsar.config;

import org.apache.pulsar.client.admin.PulsarAdmin;
import org.apache.pulsar.client.api.PulsarClientException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author wangnaiqi
 * @since 2024/3/20
 */

@Configuration
public class PulsarAdminConfig {

    @Value("${pulsar.admin-url}")
    private String adminURL;

    // 客户端
    @Bean
    public PulsarAdmin PulsarAdminConfig() throws PulsarClientException {
        return  org.apache.pulsar.client.admin.PulsarAdmin.builder().serviceHttpUrl(adminURL).build();
    }

}
